<template>
  <div>
    <button v-if="butshow" @click="show">点击我显示输入框</button>
    <input ref="inp" v-else @blur="butshow= true;" type="text" />
  </div>
</template>

<script>
export default {
  data() {
    return {
      butshow: true,
    };
  },
  methods: {
    show() {
      this.butshow = false;

      this.$nextTick(() => {
        this.$refs.inp.focus();
      });
    },
  },
  
};
</script>

<style>
</style>